package com.echo.yixiaowu.route

import kotlinx.serialization.Serializable
import kotlinx.serialization.json.Json

@Serializable
sealed class AppRoute {
    @Serializable
    data object MainTabs : AppRoute()
    @Serializable
    data object Home : AppRoute()
    @Serializable
    data object Follow : AppRoute()
    @Serializable
    data object Message : AppRoute()
    @Serializable
    data object Mine : AppRoute()

    @Serializable
    data class Detail(
        val itemId: String,
        val itemType: String
    ) : AppRoute()

    @Serializable
    data class Gallery(
        val index: Int = 0,
        val imagesJson: String
    ) : AppRoute() {
        val images: List<Pair<String, String>>
            get() = Json.decodeFromString(imagesJson)
    }
}
